<?php

// Test Database Settings
define('TEST_DB_SERVER', 'localhost');
define('TEST_DB_SERVER_USERNAME', 'root');
define('TEST_DB_SERVER_PASSWORD', 'root');
define('TEST_DB_DATABASE', 'test');
define('TEST_DB_PREFIX', '');
define('TEST_USE_PCONNECT', true);

// Path Settings
define('TEST_BASE_PATH', realpath(dirname(dirname(dirname(__FILE__)))));
define('TEST_SERVICES_PATH', TEST_BASE_PATH . '/services/');
define('TEST_INTEGRATION_PATH', TEST_BASE_PATH . '/lib/zencart/');
define('TEST_DTO_PATH', TEST_BASE_PATH . '/services/dto/');
define('TEST_CONFIGURATION_PATH', TEST_BASE_PATH . "/test/zencart/");
define('SIMPLETEST_PATH', TEST_BASE_PATH . '/lib/simpletest/');

require_once('ZenCartDatabaseWithDummyData.php');
require_once('Datasource.php');
require_once(SIMPLETEST_PATH . 'unit_tester.php');
require_once(SIMPLETEST_PATH . 'reporter.php');
require_once(TEST_SERVICES_PATH . 'POSServices.php');

class IntegrationTests extends TestSuite {
	function __construct() {
		parent::__construct('POS Services for Zen Cart Tests');
		
		$dummyDB = new ZenCartDatabaseWithDummyData();
		$dummyDB->createSchema();
		
		// Start the POSServices in test mode and as a global variable
		$testmode = true;
		$services = new POSServices($testmode);
		
		$this->addTestFile('TestOfConfiguration.php');		
		$this->addTestFile('TestOfCurrencies.php');
		$this->addTestFile('TestOfTaxes.php');
		$this->addTestFile('TestOfProductsFind.php');
		$this->addTestFile('TestOfOrdersProductsLoad.php');
		$this->addTestFile('TestOfOrdersLoad.php');
		$this->addTestFile('TestOfOrdersFind.php');
		$this->addTestFile('TestOfOrderWithAttributes.php');
		$this->addTestFile('TestOfOrderWithMultipleProducts.php');
		$this->addTestFile('TestOfOrderWithMultipleProductsAttributes.php');
		
		//$dummyDB->dropSchema();
	}
}
$testSuite = new IntegrationTests;
$testSuite->run(new HtmlReporter());
?>